//
//  PhotoCollectionViewCell.m
//  Streaming
//
//  Created by 官琛 on 15-6-24.
//  Copyright (c) 2015年 liuxun. All rights reserved.
//

#import "PhotoCollectionViewCell.h"

@implementation PhotoCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatCell];
    }
    return  self;
}

-(void)creatCell
{
    self.photoImage = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height)];
     self.photoImage.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
    [self.contentView addSubview:self.photoImage];
    [_photoImage release];
}

-(void)setPhoto:(Photo *)photo
{
    if (_photo != photo) {
        [_photo release];
        _photo = [photo retain];
        
    }
    NSURL *url = [NSURL URLWithString:photo.image];
    [self.photoImage sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"12346.jpg"]];
    
    
}





@end
